package com.mayinghao.stat.check;

import java.sql.ResultSet;
import java.sql.SQLException;


import control.database.DataBase;

public class Username_check {
	  public String us_check(String us_name)
      throws SQLException
  {
      System.out.println("*************" + us_name);
      String message = "1";
      ResultSet rs = null;
    
      DataBase db = new DataBase();
      String sql = "select * from users where username='" + us_name + "' and state!=7";
      System.out.println("username============" + sql);
      for(rs = db.executeQuery(sql); rs.next();)
          message = "0";

      rs.close();
      db.closeStmt();
      db.closeConn();
      return message;
  }
	public static void main(String[] args) {
		try {
			System.out.print(new Username_check().us_check("04318850450"));
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
